using UnityEngine;
using System.Collections;

/// <summary>
/// Menu control. Switch the screens of the game
/// ATTENTION: Screens must be added in the build settings and its name must be equal at the enum bellow. 
/// When you add a new screen you must add the same name in the enum
/// </summary>
public class SwitchScreen : MonoBehaviour 
{
	public enum Screens
	{
		Menu, Credits, Game
	}
	
	/// <summary>
	/// The key to watch. 
	/// </summary>
	public KeyCode KeyToWatch;
	
	/// <summary>
	/// The screen to go.
	/// </summary>
	public Screens ScreenToGo;
	
	// Update is called once per frame
	void Update () 
	{
		//If pressed go to selected screen
		if (Input.GetKeyDown(KeyToWatch))
		{
			Application.LoadLevel(ScreenToGo.ToString());
		}
	
	}
}
